/**
 * MealFee 业务逻辑实现类
 * @author yanwl
 * @date 2014-09-03
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.MealFee;
import com.chnbst.bstyun.model.vo.MealFeeVo;
import com.chnbst.bstyun.service.MealFeeService;

@Transactional
@Service
public class MealFeeServiceImpl extends BaseService implements MealFeeService {
	
	private final static String nameSpace = "com.chnbst.bstyun.mapper.MealFeeMapper";
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteMealFee(Integer mealFeeId) {
		return DaoHelper.delete(nameSpace, "deleteMealFee", mealFeeId);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertMealFee(MealFee mealFee) {
		return DaoHelper.insert(nameSpace, "insertMealFee", mealFee);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateMealFee(MealFee mealFee) {
		return DaoHelper.update(nameSpace, "updateMealFee", mealFee);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public MealFee selectMealFeeByMealFeeId(Integer mealFeeId) {
		return (MealFee)DaoHelper.query(nameSpace, "selectMealFeeByMealFeeId", mealFeeId);
	}
	
	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<MealFee> selectMealFees(Map<String, Object> map) {
		return (List<MealFee>)DaoHelper.list(nameSpace, "selectMealFees", map);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public MealFee selectMealFeeByMealId(Integer mealId) {
		return (MealFee)DaoHelper.query(nameSpace, "selectMealFeeByMealId", mealId);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public MealFeeVo selectMealFeeVoByMealId(Integer mealId) {
		return (MealFeeVo)DaoHelper.query(nameSpace, "selectMealFeeVoByMealId", mealId);
	}
}
